<?php
namespace app\index\model;

use think\Model;

class Product extends Model
{
    public static function goodsInfoList($get)
    {
        $list = Product::where('id','=',$get['id'])
            ->find()->toArray();
        return $list;
    }
    public static function ProductAttr($attrid)
    {
        $list = Product::suffix('_attr')
            ->alias('pa')
            ->where('pa.goods_id','=',$attrid)
            ->field('pa.*,a.attr_name')
            ->join('attribute a','pa.attr_id=a.attr_id')
            ->select()->toArray();
        return $list;
    }
    public static function cateList($id)
    {
        $list = Product::where('cid','=',$id)
            ->select();
        return $list;
    }
    public static function cateLists($name)
    {
        $list = Product::suffix('_attr')
            ->alias('pa')
            ->field('pa.goods_id')
            ->where('attr_value','=',$name)
            ->select();
        return $list;
    }
    public static function getPhotoXAttr($value)
    {
        return "https://shop.fzyhh.top/static/".$value;
    }






}